#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>
void* my_memmove(void* destination, const void* source, size_t num) {
	assert(destination && source);
	char* p = (char*)destination;
	if (destination > source) {
		while ((int)num>=0) {
			*((char*)destination + num) = *((char*)source + num);
			num--;
		}
	}
	else {
		while ((int)num>=0) {
			*((char*)destination) = *((char*)source);
			destination = (char*)destination + 1;
			source = (char*)source + 1;

			num--;
		}
	}
	return p;
}
int main()
{
	int arr[10] = { 0,1,2,3,4,5,6,7,8,9 };
	my_memmove(arr+1, arr, 5 * sizeof(int));
	for (int i = 0; i < 10; i++) {
		printf("%d ", arr[i]);
	}
	return 0;
}